package com.atguigu.gulimall.order.service;

import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.order.entity.OrderEntity;
import com.atguigu.gulimall.order.entity.OrderSubmitVO;
import com.atguigu.gulimall.order.vo.OrderConfirmVO;
import com.atguigu.gulimall.order.vo.SubmitOrderResponseVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author wuzhibin
 * @email 201746735@qq.com
 * @date 2022-06-02 16:15:58
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 订单确认页返回需要的数据
     * @return
     */
    OrderConfirmVO confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单
     * @param vo
     * @return
     */
    SubmitOrderResponseVO submitOrder(OrderSubmitVO vo);


    /**
     * 根据订单号获取订单详情
     * @param orderSn
     * @return
     */
    OrderEntity getOrderByOrderSn(String orderSn);


    /**
     * 关闭订单
     * @param order
     */
    void closeOrder(OrderEntity order);
}

